Hi Richard,
There is a c example called PWM1KHz.c that should generate a 50% duty cycle 1KHz PWM signal. Use that to test your hardware. Change the value of 128 from 0 to 255 to change the duty cycle. Change the prescale value of 65 to change the frequency if you need other than 1KHz.
Here is the SpindleMach3DAC.c example with the code for controlling the DAC replaced with code to control the PWM:
Mach3 has a concept of "Pulley Speeds". So for example if you setup a Pulley with a max speed of 4000 RPM and your GCode commands S1000 then the plugin will be sent a "speed" of 0.25 which is the fraction of max speed.
Please let us know if it works out for you.
Regards
TK
Group: DynoMotion |
Message: 1153 |
From: rhayuk |
Date: 5/18/2011 |
Subject: Re: Mach 3 KFlop spindle control |
Tom,
PWM control works a treat, I am achieving a working spindle speed from 500-5000 Rpm and with filtering on the VFD proving stable, less than 5% fluctuation on spindle speed..... however there is a small catch... If I turn the spindle off in Mach3, Reset or Estop the spindle is still happily turning. Is there variables to be included/pass through?
|
|
Group: DynoMotion |
Message: 1154 |
From: Tom Kerekes |
Date: 5/18/2011 |
Subject: Re: Mach 3 KFlop spindle control |
Hi Richard,
As written that C program assumes that besides the PWM output there are two outputs Forward and Reverse in your system. So the EX_SPINOFF case just turns both of those off assuming that having those off will stop the spindle. If you don't have those, I added code to turn off the PWM output as well. If you re-download the program you should see the change.
Regards
TK
Group: DynoMotion |
Message: 1156 |
From: rhayuk |
Date: 5/19/2011 |
Subject: Re: Mach 3 KFlop spindle control |
Tom,
Worked a treat, many thanks! Card is excellent! Has anyone else had problems with jogging using the xbox plug in within Mach 3? Hit a direction and away it goes... with no stopping!
--- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@...> wrote:
>
> Hi Richard,
>
> As written that C program assumes that besides the PWM output there are two
> outputs Forward and Reverse in your system. So the EX_SPINOFF case just turns
> both of those off assuming that having those off will stop the spindle.  If you
> don't have those, I added code to turn off the PWM output as well. If you
> re-download the program you should see the change.
>
> Regards
> TKÂ Â
>
>
>
>
> ________________________________
> From: rhayuk <rhay@...>
> To: DynoMotion@yahoogroups.com
> Sent: Wed, May 18, 2011 1:06:21 PM
> Subject: [DynoMotion] Re: Mach 3 KFlop spindle control
>
> Â
>
>
> Tom,
> PWM control works a treat, I am achieving a working spindle speed from 500-5000
> Rpm and with filtering on the VFD proving stable, less than 5% fluctuation on
> spindle speed..... however there is a small catch... If I turn the spindle off
> in Mach3, Reset or Estop the spindle is still happily turning. Is there
> variables to be included/pass through?
>
|
|
| | | |